package com.atguigu.spzx.manager.service;

import com.atguigu.spzx.manager.mapper.SysUserRoleMapper;
import com.atguigu.spzx.model.dto.system.AssginRoleDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Author yaya
 * @Create 2024/6/24 21:21
 * Description:
 */
@Service
public class SysUserRoleServiceImpl implements SysUserRoleService {

    @Autowired
    private SysUserRoleMapper sysUserRoleMapper;


    @Override
    public void doAssignRoleToUser(AssginRoleDto assginRoleDto) {
        // 先删除再新增
        sysUserRoleMapper.deleteByUserId(assginRoleDto.getUserId());
        sysUserRoleMapper.insertAssign(assginRoleDto);
    }
}
